﻿package learnmath.windows.apps{
/*-------------------------------------------------------------
	Created by: Ionel Alexandru 
	Mail: ionel.alexandru@gmail.com
	Site: www.learn-math.info
---------------------------------------------------------------*/
import learnmath.mathml.graph.*;
import learnmath.windows.elements.*;
import learnmath.windows.menu.*;
import learnmath.windows.*;
import flash.display.*;
import fl.containers.*;
import flash.net.*;
import fl.controls.*;
import flash.events.*;
import flash.text.*;

public class HelpApp extends WindowXP{

	//public var workingPannel:ScrollPane;
	var textArea:TextArea;
	
	var workingPannelW;
	var workingPannelH;
	

	public function HelpApp(_windowsManager:WindowsManager, parent:MovieClip, _littleIcon:MovieClip, _name:String, _id:String, x:int, y:int, _width:int, _height:int, _textURL:String){
		super(_windowsManager, parent, _littleIcon, _name, _id, x, y, _width, _height);
		textArea = new TextArea();
		var loader:URLLoader  = new URLLoader ();
		loader.dataFormat = URLLoaderDataFormat.TEXT;
		loader.addEventListener(Event.COMPLETE, completeHandler);
		loader.load(new URLRequest(_textURL));
	}
	
	public override function redrawWorkingPannel():void {
		workingPannelW = width-8;
		workingPannelH = height-43;
		textArea.x = 4;
		textArea.y = 21;
		textArea.width = workingPannelW
		textArea.height = workingPannelH;
		pannel.addChild(textArea);
	}
	
	function completeHandler(event:Event):void {
		textArea.htmlText = event.target.data;	
	}

	public override function drawOnFrame():void {
	}

}
}